<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      #qie {
        position: relative;
        float: right;
        left: -350px;
      }
      #cHinese{
          position: relative;
          float: right;
          left: -115px;
          font-size: 20px;
          top: 13px;
      }
      #fankui{
          position: relative;
          float: right;
          left: 80px;
          font-size: 20px;
          top: 13px;
      }
      #QQ{
          position: relative;
          float: right;
          top: 100px;
         right: 250px;
         font-size: 44px;
      }
      #eVery{
          position: relative;
          float: right;
          top: 170px;
          right: 50px;
          font-size: 28px;
      }
      #username{
          position: relative;
          width: 438px;
          height: 50px;
          top: -750px;
          right: 340px;
          float: right;
          font-size: 20px;
          line-height: 50px;
          border-radius: 4px;
      }
      #userpass{
          position: relative;
          width: 438px;
          height: 50px;
          top: -630px;
          right: -100px;
          float: right;
          font-size: 20px;
          line-height: 50px;
          border-radius: 4px;
      }
      #btn{
          width: 438px;
          height: 50px;
          border-radius: 4px;
          background-color:aqua;
          color:blue;
          font-size: 22px;
          line-height: 50px;
          text-align: center;
          float: right;
          left:543px;
          top: -522px;
          position: relative;
      }
    </style>
  </head>
  <body>
    <img src="images/01-4.jpg" alt="" />
    <img id="qie" src="images/企鹅.png" alt="" />
    <div id="cHinese">简体中文</div>
    <div id="fankui">意见反馈</div>
    <div id="QQ">欢迎登录QQ</div>
    <div id="eVery">每一天,乐在沟通</div>
    <input id="username" type="text" placeholder="昵称">
    <input id="userpass" type="password" placeholder="密码">
    <input id="btn" type="button" value="立即登录">
  </body>
</html>
<script src="./js/cookie.js"></script>
<script src="./js/jquery-3.2.1.min.js"></script>
<script src="./js/denglu.js"></script>
<script>
  var ousername = document.getElementById("username");
    var ouserpass = document.getElementById("userpass");
    var obtn = document.getElementById("btn");
    obtn.onclick = function () {
        let str = "username=" + ousername.value + "&userpass=" + ouserpass.value;
        console.log("lemai", ousername.value);
        console.log(str);
        ajaxfz("post", "denglude.php", str, function (result) {
            console.log("result", result);
            let t = new Date();
            t.setDate(t.getDate() + 3);
            document.cookie = "username=" + ousername.value; expires = t.toGMTString;
            if (result == "success") {
              alert("登录成功")
                setCookie("username", ousername.value, 7);
                location.href = "道具城.html";
            } else if (result == "fail") {
                alert("登录失败");
                location.reload();
            }
        })
    }

</script>
